package com.yswee.framework.net.http;

import com.yswee.framework.net.ITask;

public class HttpFactory {

    private static final byte[] mLock = new byte[0];
	private static HttpFactory mInstance = null;
	public final static HttpFactory get() {
        synchronized (mLock) {
            if (mInstance == null) {
                mInstance = new HttpFactory();
            }
            return mInstance;
        }
    }
	
    private HttpFactory() {
    }
    
	/**
	 * 创建http任务
	 * @param entity
	 * @param listener
	 * @return
	 */
	public <TPARSED> ITask createHttp(Entity<TPARSED> entity, Callback<TPARSED> listener) {
		Task<TPARSED> httptask = new Task<TPARSED>(entity, listener);
		return httptask;
	}
}
